﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="card_use.aspx.cs" Inherits="Default3" MaintainScrollPositionOnPostback="true" Title="油卡管理 - 油卡消费" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style7 {
            font-size: small;
            text-align: left; 
            width: 80%;
            float: left;
            display: inline;
        }

        .style21 {
            font-size: small;
        }

        .right {
            width: 18%;
            float: right;
        }

        #newdata {
            color: rgb(51, 51, 51);
            font-size: small;
            border-collapse: collapse;
        }
    </style>
    <script language="JavaScript" type="text/javascript" src="Js/datejs/WdatePicker.js"
        defer="defer"></script>
    <script language="JavaScript" type="text/javascript" src="Js/Calendar.js"></script>
    <script src="Js/jquery.min.js"></script>
    <script src="Js/webcam/webcam.js"></script>
    <script language="JavaScript">
        //增加拍照上传160429
        var type = 0;
        $(function () {
            ShowHideOil($("#<%=ddlCarNum.ClientID %>").val());
            // 绑定keyup和change事件 
            $("#<%=ddlCarNum.ClientID %>").bind("keyup change", function () {ShowHideOil($(this).val());});
            openwebcam();
        });
        function ShowHideOil(carnum) {
            $("#<%=txtOil.ClientID %>").val("");
            $("#<%=txtBDS.ClientID %>").val("");
            if (carnum != "" && carnum.split("|")[1] == "1") {
                $(".caroil").show();
                ValidatorEnable($("#<%=vOil1.ClientID %>")[0], true);//启用验证控件
                    ValidatorEnable($("#<%=vOil2.ClientID %>")[0], true);//启用验证控件
                    ValidatorEnable($("#<%=vBDS1.ClientID %>")[0], true);//启用验证控件
                    ValidatorEnable($("#<%=vBDS2.ClientID %>")[0], true);//启用验证控件
                }
                else {
                    $(".caroil").hide();
                    ValidatorEnable($("#<%=vOil1.ClientID %>")[0], false);//禁用验证控件
                    ValidatorEnable($("#<%=vOil2.ClientID %>")[0], false);//禁用验证控件
                    ValidatorEnable($("#<%=vBDS1.ClientID %>")[0], false);//禁用验证控件
                    ValidatorEnable($("#<%=vBDS2.ClientID %>")[0], false);//禁用验证控件
                }
        }
        function openwebcam()
        {
            if (type == 1) {
                type = 0;
                $("#changetype").text("文件上传");
                $("#file").hide();
                $("#webcam,#results,#takesnap").show();
                ValidatorEnable($("#<%=vPic.ClientID %>")[0], false);//禁用验证控件
                ValidatorEnable($("#<%=vWebCam.ClientID %>")[0], true);//启用验证控件
                Webcam.set({
                    width: 320,
                    height: 240,
                    dest_width: 960,
                    dest_height: 720,
                    crop_width: 960,
                    crop_height: 720,
                    force_flash: true,
                    image_format: 'jpeg',
                    jpeg_quality: 100
                });
                Webcam.attach('webcam');
            }
            else {
                type = 1;
                $("#changetype").text("拍照上传");
                $("#file").show();
                $("#webcam,#results,#takesnap").hide();
                $("#results").html("");
                $("#<%=hidPic_base64.ClientID %>").val("");
                ValidatorEnable($("#<%=vPic.ClientID %>")[0], true);//启用验证控件
                ValidatorEnable($("#<%=vWebCam.ClientID %>")[0], false);//禁用验证控件
            }
        }
        function take_snapshot() {
            Webcam.snap(function (data_uri) {
                $("#<%=hidPic_base64.ClientID %>").val(data_uri);
                $('#results').html('<img width=320 height=240 src="' + data_uri + '"/>');
                ValidatorEnable($("#<%=vWebCam.ClientID %>")[0], true);//启用验证控件
            });
        }
</script>
</head>
<body background="images/login-bg.jpg">
    <form id="form1" runat="server">
        <div style="text-align: center">
            <div class="style7">
                <span>当前位置：</span><asp:HyperLink ID="HyperLink1" runat="server"
                    NavigateUrl="~/index.aspx" Style="color: #000000"
                    ToolTip="点击返回主页面">主页面</asp:HyperLink>
                <span>→ 编辑</span>油卡消费<br class="style7" />
                <br />
            </div>
            <div class="right">
                <br />
            </div>
            <br />
            <div>
                <table id="table7" align="center" border="0" cellpadding="0" cellspacing="0"
                        width="95%">
                        <tr>
                            <td height="10" width="9">
                                <img align="absMiddle" border="0" height="10" src="images/l_1_1.jpg"
                                    width="9" /></td>
                            <td background="images/l_1_8.jpg" width="100%"></td>
                            <td height="10" width="9">
                                <img align="absMiddle" border="0" height="10" src="images/l_1_7.jpg"
                                    width="9" /></td>
                        </tr>
                        <tr>
                            <td background="images/l_1_2.jpg" class="style22"></td>
                            <td align="left" bgcolor="#ffffff" valign="top" width="100%" class="style22">
                                <table id="table8" align="center" border="0" cellpadding="0" cellspacing="0"
                                    width="100%">
                                    <tr>
                                        <td class="style18"><b>&nbsp; 日期范围:<asp:TextBox ID="txtTime0" runat="server" onclick="showcalendar(this)" Width="80px"/>
                                            至<asp:TextBox ID="txtTime1" runat="server" onclick="showcalendar(this)" Width="80px"/>
卡号:<asp:DropDownList ID="ddlCardNum0" runat="server" AppendDataBoundItems="True" DataSourceID="dsCardNum" DataTextField="card" DataValueField="cardnum">
                                    <asp:ListItem Value="">==请选择==</asp:ListItem>
                                </asp:DropDownList><br />&nbsp; 
加油班组:
                                <asp:DropDownList ID="ddlBzName0" runat="server" AppendDataBoundItems="True" DataSourceID="dsBzname" DataTextField="bzname" DataValueField="jgname">
                                    <asp:ListItem Value="">==请选择==</asp:ListItem>
                                </asp:DropDownList>
加油车号:<asp:TextBox ID="txtCarNum0" runat="server" Width="80px"/>
持卡人:<asp:TextBox ID="txtOwner0" runat="server" Width="80px"/>
备注:<asp:TextBox ID="txtMemo0" runat="server" Width="80px"/></b><br /><br />
                                            
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;
                                <asp:Label ID="Label_tiaojian" runat="server" Style="color: #FF3300"
                                    Text="Label"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table id="table9" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                <tr>
                                                    <td background="images/line.jpg" height="1"></td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <table id="table10" border="0" cellpadding="0" cellspacing="0" width="100%">
                                                            <tr>
                                                                <td align="middle" height="35" width="24%">
                                                                    <img align="absMiddle" border="0" height="25" src="images/l_1_10.jpg"
                                                                        width="19" /></td>
                                                                <td align="left" style="text-align: center" width="54%">
                                                                    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/sub_1.jpg"
                                                                        OnClick="ImageButton1_Click" />
                                                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                        <asp:ImageButton ID="ImageButton2" runat="server"
                                                            ImageUrl="~/images/sub_2.jpg" OnClick="ImageButton2_Click" />
                                                                </td>
                                                                <td align="middle" valign="center" width="22%">
                                                                    <img align="absMiddle" border="0" height="15" src="images/l_1_12.jpg"
                                                                        width="49" /></td>
                                                            </tr>
                                                        </table>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td background="images/l_1_6.jpg" class="style22"></td>
                        </tr>
                        <tr>
                            <td height="10" width="9">
                                <img align="absMiddle" border="0" height="10" src="images/l_1_3.jpg"
                                    width="9" /></td>
                            <td background="images/l_1_4.jpg"></td>
                            <td height="10" width="9">
                                <img align="absMiddle" border="0" height="10" src="images/l_1_5.jpg"
                                    width="9" /></td>
                        </tr>
                    </table>
            </div>
            <br />
            <b>
                <br />
                油卡消费列表<br />
                <br />
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" Width="90%"
                    AutoGenerateColumns="False" CellPadding="4" DataKeyNames="id,i,amount,cardid,bzname_,carnum_,bzname,carnum,lastbds"
                    DataSourceID="SqlDataSource1" EmptyDataText="没有油卡消费数据"
                    EnableModelValidation="True" ForeColor="#333333" GridLines="None"
                    Style="text-align: center; font-size: small"
                    OnRowDataBound="GridView1_RowDataBound" OnRowDeleted="GridView1_RowDeleted" PageSize="30" OnPageIndexChanging="GridView1_PageIndexChanging">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:CommandField ShowDeleteButton="True" /><asp:TemplateField HeaderText="序号" ItemStyle-ForeColor="Gray"></asp:TemplateField>
                        <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True" SortExpression="id" Visible="False" />
                        <asp:BoundField DataField="cardid" HeaderText="cardid" InsertVisible="False" ReadOnly="True" SortExpression="cardid" Visible="False"/>
                        <asp:BoundField DataField="changetime" HeaderText="日期" ItemStyle-Width="100" SortExpression="changetime" DataFormatString="{0:yyyy-MM-dd}" />
                        <asp:BoundField DataField="cardnum" HeaderText="卡号【车号】" SortExpression="cardnum" />
                        <asp:BoundField DataField="amount" HeaderText="消费金额（元）" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" SortExpression="amount" DataFormatString="{0:C}" />
                        <asp:BoundField DataField="balance" HeaderText="当前余额（元）" ItemStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right" SortExpression="balance" DataFormatString="{0:C}" />
                        <asp:BoundField DataField="bzname" HeaderText="加油班组" SortExpression="bzname" />
                        <asp:BoundField DataField="carnum" HeaderText="加油车号" ItemStyle-Width="70" SortExpression="carnum" />
                        <asp:BoundField DataField="oil" HeaderText="加油量（升）" SortExpression="oil" />
                        <asp:BoundField DataField="bds" HeaderText="公里底数（KM）" SortExpression="bds" />
                        <asp:BoundField DataField="bglyh" HeaderText="百公里油耗" SortExpression="bglyh" />
                        <asp:BoundField DataField="pic" HeaderText="加油小票" ItemStyle-Width="40" SortExpression="pic" DataFormatString="<a href='upload/{0}' target='_blank'>加油小票</a>" HtmlEncode="false" />
                        <asp:BoundField DataField="currentowner" HeaderText="持卡人" ItemStyle-Width="80" SortExpression="currentowner" />
                        <asp:BoundField DataField="memo" HeaderText="备注" ItemStyle-HorizontalAlign="Left" SortExpression="memo" ItemStyle-Width="220" HtmlEncode="false" />
                        <asp:BoundField DataField="planid" HeaderText="燃油计划" SortExpression="planid" Visible="false" />
                    </Columns>
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#336699" Font-Bold="True" ForeColor="#333333" />
                </asp:GridView>
                <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                    ConnectionString="<%$ ConnectionStrings:xxnewsConnectionString %>"
                    DeleteCommand="
UPDATE t SET balance = balance-(@amount)
FROM (select ROW_NUMBER() over (order by changetime desc,addtime desc,id desc) as i,ka.*
from youkaguanli_card_detail as ka) t
where i<@i and cardid=@cardid;DELETE FROM youkaguanli_card_detail WHERE (id = @id);
UPDATE youkaguanli_card set balance=balance-(@amount) where cardnum=@cardid;"
                    InsertCommand="
insert into youkaguanli_card_detail(cardid,type,inout,changetime, amount, balance, jgname,bzname,carnum,currentowner,pic,memo,addname, addip,oil,lastbds,bds,bglyh)
select top(1) @cardid,1,-1,@changetime, @amount, case when d.cardid='0' or d.balance is null then c.balance else d.balance end+(@amount) ,@jgname,@bzname,@carnum,c.owner,@pic,@memo,@addname , @addip,@oil,@lastbds,@bds,@bglyh
from youkaguanli_card as c left join youkaguanli_card_detail as d on  c.cardnum = d.cardid
where (d.changetime is null or d.changetime&lt;=cast(@changetime as smalldatetime)) and c.cardnum=@cardid
order by d.changetime desc,d.addtime desc,d.id desc;
UPDATE t SET balance = balance+(@amount)
FROM (select ROW_NUMBER() over (order by changetime desc,addtime desc,id desc) as i,ka.*
from youkaguanli_card_detail as ka) t
where changetime>cast(@changetime as smalldatetime) and cardid=@cardid;
UPDATE youkaguanli_card set balance=balance+(@amount) where cardnum=@cardid;"
                    SelectCommand="
select t.*,c.owner,c.bzname as bzname_,c.carnum as carnum_,t.cardid+'【'+ISNULL(c.carnum,'无车号')+'】' as cardnum FROM (SELECT ROW_NUMBER() over (order by changetime desc,addtime desc,id desc) as i
,* FROM  youkaguanli_card_detail) as t
left join youkaguanli_card as c on t.cardid=c.cardnum
WHERE inout=-1 and (@jgname='设备科' or c.jgname=@jgname or c.bzname=@bzname) order by i">
                    <DeleteParameters>
                        <asp:Parameter Name="id" />
                        <asp:Parameter Name="i" />
                        <asp:Parameter Name="amount" />
                        <asp:Parameter Name="cardid" />
                    </DeleteParameters>
                    <InsertParameters>
                        <asp:Parameter Name="cardid" />
                        <asp:Parameter Name="changetime" Type="DateTime" />
                        <asp:Parameter Name="amount" Type="Decimal" />
                        <asp:Parameter Name="jgname" />
                        <asp:Parameter Name="bzname" />
                        <asp:Parameter Name="carnum" />
                        <asp:Parameter Name="pic" />
                        <asp:Parameter Name="memo" />
                        <asp:Parameter Name="addname" />
                        <asp:Parameter Name="addip" />
                        <asp:Parameter Name="oil" Type="Decimal" />
                        <asp:Parameter Name="lastbds" Type="Decimal" />
                        <asp:Parameter Name="bds" Type="Decimal" />
                        <asp:Parameter Name="bglyh" Type="Decimal" />
                    </InsertParameters>
                    <SelectParameters>
                        <asp:SessionParameter DbType="String" Name="jgname" SessionField="pnchejian" />
                        <asp:SessionParameter DbType="String" Name="bzname" SessionField="pn" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="dsCardNum" runat="server"
                    ConnectionString="<%$ ConnectionStrings:xxnewsConnectionString %>"
                    SelectCommand="SELECT cardnum,owner+cardnum + '(余额：' + CAST(balance AS varchar) + ')'+isnull(carnum,'') as [card] FROM [youkaguanli_card]
where enabled=1 and (bzname=@bzname or @bzname='设备科')
order by ordernum">
                    <SelectParameters>
                        <asp:SessionParameter DbType="String" Name="bzname" SessionField="pn" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="dsBzname" runat="server"
                    ConnectionString="<%$ ConnectionStrings:xxnewsConnectionString %>"
                    SelectCommand="select ch_pwname bzname,bm_leibie+'|'+ch_pwname jgname from (select bm_leibie,ch_pwname,in_id,ch_px FROM siteman WHERE (ch_pwname = '设备科') or (ch_pwname = '材料科') or ch_pwname in(SELECT DISTINCT banzu1 FROM tcjcb) or ch_pwname in(SELECT DISTINCT banzu1 FROM tcjcb_qiche)  or ch_pwname in(SELECT DISTINCT banzu1 FROM tcjcb_fadianji) group by bm_leibie,ch_pwname,in_id,ch_px) as t
                    /*where bm_leibie=@bzname or ch_pwname=@bzname*/ ORDER BY ch_px">
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="dsCarNum" runat="server"
                    ConnectionString="<%$ ConnectionStrings:xxnewsConnectionString %>"
                    SelectCommand="SELECT chehao, xuhao, 1 AS type, banzu1,chehao + '|1' as chehaoandtype FROM tcjcb_qiche WHERE (banzu1 =@banzu1) UNION SELECT chehao, xuhao, 2 AS type, banzu1,chehao + '|2' as chehaoandtype FROM tcjcb WHERE (banzu1 =@banzu1) UNION SELECT chehao, xuhao, 3 AS type, banzu1,chehao + '|3' as chehaoandtype FROM tcjcb_fadianji WHERE (banzu1 =@banzu1) ORDER BY type, xuhao">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddlbzname" Name="banzu1" PropertyName="SelectedItem.Text" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <br />
                <table id="newdata" border="0" cellspacing="0" cellpadding="4">
                    <tbody>
                        <tr align="left">
                            <td align="right">日期<font color="red">*</font></td>
                            <td>
                                <asp:TextBox ID="txtChangeTime" runat="server" onclick="showcalendar(this)" Width="120px"/>
                                <asp:RequiredFieldValidator ID="vChangeTime" runat="server" ControlToValidate="txtChangeTime" ErrorMessage="请输入日期" SetFocusOnError="True" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr align="left">
                            <td align="right">卡号<font color="red">*</font></td>
                            <td>
                                <asp:DropDownList ID="ddlCardNum" runat="server" AppendDataBoundItems="True" DataSourceID="dsCardNum" DataTextField="card" DataValueField="cardnum">
                                    <asp:ListItem Value="">==请选择==</asp:ListItem>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="vCardNum" runat="server" ControlToValidate="ddlCardNum" ErrorMessage="请选择消费的油卡" SetFocusOnError="True" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr align="left">
                            <td align="right">消费金额（元）<font color="red">*</font></td>
                            <td>
                                <asp:TextBox ID="txtAmount" runat="server" Width="120px" Style="ime-mode: disabled" onkeypress="if((event.keyCode<48 ||event.keyCode>57) &&event.keyCode!=46) {event.returnValue=false;} else {event.returnValue=true;}" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtAmount" ErrorMessage="请输入消费金额（元）" Display="Dynamic" SetFocusOnError="True" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ControlToValidate="txtAmount" Display="Dynamic" ErrorMessage="消费金额（元）必须大于等于0" SetFocusOnError="True" ValidationExpression="\d+(.\d+)?" ValidationGroup="Insert"></asp:RegularExpressionValidator>
                           </td>
                        </tr>
                        <tr align="left">
                            <td align="right">加油班组<font color="red">*</font></td>
                            <td>
                                <asp:DropDownList ID="ddlbzname" runat="server" AppendDataBoundItems="True" AutoPostBack="True" DataSourceID="dsBzname" DataTextField="bzname" DataValueField="jgname" OnSelectedIndexChanged="ddlbzname_SelectedIndexChanged">
                                    <asp:ListItem Value="">==请选择==</asp:ListItem>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="vbzname" runat="server" ControlToValidate="ddlbzname" ErrorMessage="请选择加油单位" SetFocusOnError="True" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr align="left">
                            <td align="right">加油车号<font color="red">*</font></td>
                            <td>
                                <asp:DropDownList ID="ddlCarNum" runat="server" Width="120px" AppendDataBoundItems="True" DataSourceID="dsCarNum" DataTextField="chehao" DataValueField="chehaoandtype">
                                    <asp:ListItem Value="">==请选择==</asp:ListItem>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ID="vCarNum" runat="server" ControlToValidate="ddlCarNum" ErrorMessage="请选择加油车号" SetFocusOnError="True" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr align="left" class="caroil">
                            <td align="right">加油量（升）<font color="red">*</font></td>
                            <td>
                                <asp:TextBox ID="txtOil" runat="server" Width="120px" Style="ime-mode: disabled" onkeypress="if((event.keyCode<48 ||event.keyCode>57) &&event.keyCode!=46) {event.returnValue=false;} else {event.returnValue=true;}" />
                                    <asp:RequiredFieldValidator ID="vOil1" runat="server" ControlToValidate="txtOil" ErrorMessage="请输入加油量（升）" Display="Dynamic" SetFocusOnError="True" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="vOil2" runat="server" ControlToValidate="txtOil" Display="Dynamic" ErrorMessage="加油量（升）必须大于等于0" SetFocusOnError="True" ValidationExpression="\d+(.\d+)?" ValidationGroup="Insert"></asp:RegularExpressionValidator>
                           </td>
                        </tr>
                        <tr align="left" class="caroil">
                            <td align="right">公里底数（KM）<font color="red">*</font></td>
                            <td>
                                <asp:TextBox ID="txtBDS" runat="server" Width="120px" Style="ime-mode: disabled" onkeypress="if((event.keyCode<48 ||event.keyCode>57) &&event.keyCode!=46) {event.returnValue=false;} else {event.returnValue=true;}" />
                                    <asp:RequiredFieldValidator ID="vBDS1" runat="server" ControlToValidate="txtBDS" ErrorMessage="请输入公里底数（KM）" Display="Dynamic" SetFocusOnError="True" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="vBDS2" runat="server" ControlToValidate="txtBDS" Display="Dynamic" ErrorMessage="公里底数（KM）必须大于等于0" SetFocusOnError="True" ValidationExpression="\d+(.\d+)?" ValidationGroup="Insert"></asp:RegularExpressionValidator>
                           </td>
                        </tr>
                        <tr align="left">
                            <td align="right">加油小票<font color="red">*</font></td>
                            <td>
                                <div id="file" style="float:left;">
                                    <asp:FileUpload ID="fPic" runat="server" Width="120px"/>
                                    <asp:RequiredFieldValidator ID="vPic" runat="server" ControlToValidate="fPic" ErrorMessage="请上传加油小票照片" SetFocusOnError="True" ValidationGroup="Insert" Display="Dynamic"></asp:RequiredFieldValidator>
                                </div>
                                <a id="changetype" href="javascript:void(0)" onclick="openwebcam()" style="float:left;font-size:large;">拍照上传</a>
                                <div id="takesnap">
                                    <asp:TextBox ID="hidPic_base64" runat="server" style="display:none;"></asp:TextBox>
                                    <input type="button" value="点击这里拍照" class="btn" onclick="take_snapshot();"/>
                                    <asp:RequiredFieldValidator ID="vWebCam" runat="server" ControlToValidate="hidPic_base64" ErrorMessage="请给加油小票拍照" SetFocusOnError="True" ValidationGroup="Insert" Display="Dynamic"></asp:RequiredFieldValidator>
                                </div>
                                <div id="webcam" style="clear:left;float:left">
                                    <!--调用摄像组件并显示图像-->
                                </div>
                                <div id="results" style="float:left;margin-left:10px;">
                                   <!--显示上传结果-->
                                </div>
                            </td>
                        </tr>
                        <tr align="left">
                            <td align="right">备注</td>
                            <td>
                                <asp:TextBox ID="txtMemo" runat="server" TextMode="MultiLine" Rows="6"/>
                            </td>
                        </tr>
                    </tbody>
                </table>

                <span class="style8">
                    <br />
                </span>
                <br />
                <span class="style6">
                    <asp:Button ID="Button1" runat="server" CssClass="style1"
                        OnClick="Button1_Click" Text="添加" ValidationGroup="Insert" />&nbsp;&nbsp;<asp:Button ID="Button3" runat="server" PostBackUrl="~/index.aspx" Text="返回主页面" />
                    <br />
                </span>
            </b>
            <span class="style21">&nbsp;
        &nbsp; </span>
            <span class="style21">&nbsp;&nbsp;</span><br class="style1" />
            <span class="style21">添加人：</span><asp:Label ID="Label1" runat="server"
                CssClass="style21" Text="Label"></asp:Label>
            <span class="style21">&nbsp; </span>
            <asp:Label ID="Label2" runat="server" CssClass="style21" Text="Label"></asp:Label>
            <span class="style21">&nbsp; </span>
            <asp:Label ID="Label3" runat="server" CssClass="style21" Text="Label"></asp:Label>
        </div>
    </form>
    <p class="style21" style="text-align: center">
        &nbsp;<br />
        &nbsp;安康供电段信息中心制作 2015
    </p>
</body>
</html>
